package com.hcb.tonguetiphealth.model;

import com.hcb.tonguetiphealth.util.StringUtils;


public class Comment extends AbstractTask{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String user;
	private String time;
	private String content;
	private float rating;
	private String product;
	private String environment;
	private String serve;
	
	private String yyjz;//营养价值
	private String lfzs;//浪费指数
	private String sjhl;//时间合理
	private String cpdp;//菜品搭配
	
	//private SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	public String getUser() {
		return user;
	}
	public void setUser(String user) {
		this.user = user;
	}
	public String getTime() {
		/*long lTime = StringUtils.parseLong(time);
		lTime = lTime==0 ? System.currentTimeMillis() : lTime;
		Date curDate = new Date(lTime);
		formatter.format(curDate);
		return formate(formatter.format(curDate));*/

		return formate(time);
	}
	public void setTime(String time) {
		this.time = time;
	}
	public String getTime1() {
		return time;
	}
	public String getContent() {
		return formate(content);
	}
	public void setContent(String content) {
		this.content = content;
	}
	public float getRating() {
		return rating;
	}
	public void setRating(float rating) {
		this.rating = rating;
	}
	public String getProduct() {
		return exchenge(product);
	}
	public void setProduct(String product) {
		this.product = product;
	}
	public String getEnvironment() {
		return exchenge(environment);
	}
	public void setEnvironment(String environment) {
		this.environment = environment;
	}
	public String getServe() {
		return exchenge(serve);
	}
	public void setServe(String serve) {
		this.serve = serve;
	}
	
	private String exchenge(String str) {
		String result = "";
		int i = StringUtils.parseInt(str);
		switch(i) {
		case 0:
			result = "差";
			break;
		case 1:
			result = "一般";
			break;
		case 2:
			result = "好";
			break;
		case 3:
			result = "很好";
			break;
		case 4:
			result = "非常好";
			break;
		default:
			break;
		}
		return result;
	}
	public String getYyjz() {
		return yyjz;
	}
	public void setYyjz(String yyjz) {
		this.yyjz = yyjz;
	}
	public String getLfzs() {
		return lfzs;
	}
	public void setLfzs(String lfzs) {
		this.lfzs = lfzs;
	}
	public String getSjhl() {
		return sjhl;
	}
	public void setSjhl(String sjhl) {
		this.sjhl = sjhl;
	}
	public String getCpdp() {
		return cpdp;
	}
	public void setCpdp(String cpdp) {
		this.cpdp = cpdp;
	}
	
	
}
